using System;
using OracleInternal.Common;

namespace Oracle.ManagedDataAccess.Client
{
	public sealed class OracleHAEventArgs : EventArgs
	{
		private OracleHAEventSource m_source;

		private OracleHAEventStatus m_status;

		private string m_service;

		private string m_database;

		private string m_databaseDomain;

		private string m_host;

		private string m_instance;

		private string m_reason;

		private DateTime m_time;

		private int m_drain_timeout;

		internal bool m_bFireHADotNetEvent = true;

		public OracleHAEventSource Source => m_source;

		public OracleHAEventStatus Status => m_status;

		public string ServiceName => m_service;

		public string DatabaseName => m_database;

		public string DatabaseDomainName => m_databaseDomain;

		public string HostName => m_host;

		public string InstanceName => m_instance;

		public string Reason => m_reason;

		public DateTime Time => m_time;

		public int DrainTimeout => m_drain_timeout;

		internal OracleHAEventArgs(OracleHAEventSource source, OracleHAEventStatus status, string service, string database, string databaseDomain, string instance, string host, string reason, DateTime time, int drain_timeout)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleHAEventArgs, OracleTraceFuncName.ctor);
			}
			try
			{
				m_source = source;
				m_status = status;
				if (service != null && service.Length > 0)
				{
					m_service = service;
				}
				if (database != null && database.Length > 0)
				{
					m_database = database;
				}
				if (databaseDomain != null && databaseDomain.Length > 0)
				{
					m_databaseDomain = databaseDomain;
				}
				if (instance != null && instance.Length > 0)
				{
					m_instance = instance;
				}
				m_host = host;
				m_reason = reason;
				m_time = time;
				m_drain_timeout = drain_timeout;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleHAEventArgs, OracleTraceFuncName.ctor);
				}
			}
		}
	}
}
